<?php

namespace Database\Seeders;

use App\Models\ConnectionsTypesModel;
use App\Models\ServerModel;
use Illuminate\Database\Seeder;

class ServersSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        ServerModel::factory()->create()->each(
            function (ServerModel $server) {
                $conn = ConnectionsTypesModel::query()
                    ->where('id', '=', '1')
                    ->first();
                var_dump($conn->id);
                $server->connections()->attach(
                    $conn->id);
            }
        );
    }
}
